<form class="form-inline" method="get">

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" type="number" name="mobile" value="{$mobile}"
                   placeholder="手机号">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="real_name" value="{$real_name}"
                   placeholder="姓名">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="bussiness_name" value="{$bussiness_name}"
                   placeholder="商会名称|商会ID">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="department_name" value="{$department_name}"
                   placeholder="组织结构名称|组织结构ID">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <select id="dutise-selector" name="duties_id" class="form-control" tabindex="-1">
            <option value="">
                无选择
            </option>
            {volist name="duties_list" id="item"}
            <option value="{$item.id}" {if condition="$duties_id==$item.id"}selected{/if}>{$item.title}</option>
            {/volist}
        </select>
    </div>

    <div class="form-group col-xs-2">
        <select id="industry-selector" name="industry_id" class="form-control" tabindex="-1">
            <option value="">
                无选择
            </option>
            {volist name="industry_list" id="item"}
            <option value="{$item.id}" {if condition="$industry_id==$item.id"}selected{/if}>{$item.title}</option>
            {/volist}
        </select>
    </div>

    <br><br><br>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="identity-selector" name="identity_id" class="form-control" tabindex="-1">
                <option value="">
                    无选择
                </option>
                <?php foreach($identity_list as $itk=>$item){ ?>
                <option value="{$itk}" {if condition="$identity_id==$itk"}selected{/if}>{$item}</option>
                <?php } ?>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-4">
        <div class="col-xs-12">
            <span style="">注册时间</span>{include file="public/dateRangePicker" picker-name="time_range" /}
        </div>
    </div>

    <div class="form-group col-xs-3">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                搜索
            </button>
        </div>
    </div>
</form>

<hr>

<table class="table table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>手机【姓名】</td>
        <td>头像</td>
        <td>商会</td>
        <td>组织部门</td>
        <td>职务</td>
        <td>行业</td>
        <td>身份【激活】</td>
        <td>可提现余额</td>
        <td>H链资产</td>
        <td>联盟商</td>
        <td>黑名单</td>
        <td>注册时间</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td>
            <p>
                <label class="label label-danger">{$item.mobile}</label>
            </p>
            <p>
                <label class="label label-info">{$item.real_name}</label>
            </p>
        </td>
        <td>
            <a href="javascript:void(0);" onclick="ejectImg('{$item.avatar|default='/static/default_avatar.png'}','{$item.real_name}头像');">
                <img src="{$item.avatar|default='/static/default_avatar.png'}" style="width: 60px;height: 60px;">
            </a>
        </td>
        {if condition="$item.bussiness_id gt 0"}
        <td>{$item.bussiness_name|default='已删除'}【ID：{$item.bussiness_id}】</td>
        {else/}
        <td>暂无</td>
        {/if}
        {if condition="$item.department_id gt 0"}
        <td>{$item.department_name|default='已删除'}【ID：{$item.department_id}】</td>
        {else/}
        <td>暂无</td>
        {/if}
        {if condition="$item.duties_id gt 0"}
        <td>{$item.duties_name|default='已删除'}【ID：{$item.duties_id}】</td>
        {else/}
        <td>暂无</td>
        {/if}
        {if condition="$item.industry_id gt 0"}
        <td>{$item.industry_name|default='已删除'}【ID：{$item.industry_id}】</td>
        {else/}
        <td>暂无</td>
        {/if}

        {if condition="$item.identity==2"}
        <td>
            <label class="label label-success">荣誉会员【已激活】</label>
        </td>
        {else/}
        <td>
            <label class="label label-danger">游客【未激活】</label>
        </td>
        {/if}

        <td>
            <label class="label label-warning">￥{$item.money}</label>
        </td>
        <td>
            {if condition="@$hlarr[$item['mobile']] != ''"}
                {if condition="@$hlarr[$item['mobile']] == 'none'"}
                    <label class="label label-danger">暂未开通钱包</label>
                {else/}
                    <label class="label label-success"><?php echo @$hlarr[$item['mobile']]; ?></label>
                {/if}
            {/if}
        </td>
        <td>
            {if condition="$item.is_union == 1"}
            <label class="label label-success">是</label>
            {else/}
            <label class="label label-danger">否</label>
            {/if}
        </td>
        <td>
            {if condition="$item.in_blacklist==1"}
            <label class="label label-danger">已拉黑</label>
            {else/}
            <label class="label label-success">未拉黑</label>
            {/if}
        </td>
        <td>{$item.create_time|show_datetime}</td>

    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$list->render()}
    </div>
</div>

<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {

        //获取分类
        $("#dutise-selector").select2({
            placeholder: "选择职务",
            allowClear: true
        });
        $("#industry-selector").select2({
            placeholder: "选择行业",
            allowClear: true
        });
        $("#identity-selector").select2({
            placeholder: "选择身份【激活状态】",
            allowClear: true
        });
    });
</script>
